import 'user.dart';

/// 登录信息
class LoginInfoEntity {
  int ret;
  User data;
  String msg;

  LoginInfoEntity({this.ret, this.data, this.msg});

  LoginInfoEntity.fromJson(Map<String, dynamic> json) {
    // ret 和 msg 要先解析，不然，data 解析失败后，可能 ret 和 msg 都为空
    ret = json['ret'];
    msg = json['msg'];
    data = json['data'] != null ? new User.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ret'] = this.ret;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['msg'] = this.msg;
    return data;
  }
}

